import router from "./router";
import { useUserStore } from "./stores/user";


// WHITE_LIST白名单 
const WHITE_LIST=['/login',"/404"];

router.beforeEach((to,from,next)=>{
    console.log({to,from});
     // 获取store
    const userStore=useUserStore();
   if(userStore.token){
    next();
   }else if(WHITE_LIST.includes(to.path)){
    next();
}else{
    next('/login');
};

});